package com.cy.web.action.system;

import java.util.LinkedHashMap;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.cy.bean.Paging;
import com.cy.bean.system.IndexNavi;
import com.cy.service.system.IndexNaviService;
import com.cy.web.action.BaseAction;
import com.opensymphony.xwork2.ActionContext;

/**
 * 首页导航控制器
 * @author CY
 *
 */
@Controller
@Scope("prototype")
public class IndexNaviAction extends BaseAction {

	@Resource
	private IndexNaviService indexNaviService;
	
	/**
	 * 首页导航列表
	 * 
	 * @return
	 */
	public String list() {
		Paging<IndexNavi> paging = new Paging<IndexNavi>(getPage());
		LinkedHashMap<String, String> orderby = new LinkedHashMap<String, String>();
		orderby.put("indexNavi_order", "asc");
		paging.setQueryResult(indexNaviService.getScrollData(paging.getfirstResult(),paging.getMaxResult(), orderby));
		ActionContext.getContext().put("paging", paging);
		return "list";
	}
}
